package ClassTest;

/**
 * Created by 春旺 on 2017/9/24.
 */
public class NumberSort {
    public int [] sort (int[]a){
        if (a.length == 3){
           if (a[0] > a[1]){
               swap(a,a[0],a[1]);
           }
           if (a[1]> a[2]){
               swap(a,a[1],a[2]);
               }
return a;
    }
    else
        return null;
    }
    private static void swap (int[] data, int index1, int index2)
    {
       int temp = data[index1];
        data[index1] = data[index2];
        data[index2] = temp;
    }

}
